package com.cta.view.json;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

public class RecoveryFile {

	private boolean isRecovery;
	private String fileName;
	private List<RecoveryFileData> datas = new ArrayList<RecoveryFileData>();

	public RecoveryFile(String fileName) {
		this.fileName = fileName;
		if(StringUtils.isNotEmpty(fileName) && fileName.contains("ok")){
			this.isRecovery = true;
		}
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	
	public void addData(String data){
		if(StringUtils.isNotEmpty(data) && data.indexOf("-") > 0){
			String[] split = data.split("-");
			datas.add(new RecoveryFileData(split[1], split[0]));
		}
	}

	public List<RecoveryFileData> getDatas() {
		return datas;
	}

	public void setDatas(List<RecoveryFileData> datas) {
		this.datas = datas;
	}

	public boolean isRecovery() {
		return isRecovery;
	}

	public void setRecovery(boolean isRecovery) {
		this.isRecovery = isRecovery;
	}

	
}
